
<extend name="Common/common"/>

<block name="content">
<article class="page-container">
	<form action="{:U('addNavigation')}" method="post" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>导航名称：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$nav['navigation']}" placeholder="" id="mobile" name="navigation">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>控制器：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$nav['controller']}" placeholder="" name="controller" id="email">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>方法：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$nav['action']}" placeholder="" id="mobile" name="action">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>外部链接：</label>
			<div class="formControls col-xs-8 col-sm-9">
				<input type="text" class="input-text" value="{$nav['url']}" placeholder="" id="mobile" name="url">
			</div>
		</div>
		
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>是否显示：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="is_show" type="radio" value="1" id="sex-1" <if condition="empty($nav)">checked<else/><if condition="$nav['is_show']==1">checked</if></if> >
					<label for="sex-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" name="is_show" <if condition="!empty($nav) && $nav['is_show']==0">checked</if> value="0">
					<label for="sex-2">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>新窗口打开：</label>
			<div class="formControls col-xs-8 col-sm-9 skin-minimal">
				<div class="radio-box">
					<input name="is_new_window" value="1" type="radio" id="sex-1" <if condition="$nav['is_new_window']==1">checked</if> >
					<label for="sex-1">是</label>
				</div>
				<div class="radio-box">
					<input type="radio" id="sex-2" name="is_new_window" value="0" <if condition="empty($nav)">checked<else/><if condition="!empty($nav) && $nav['is_new_window']==0">checked</if></if>>
					<label for="sex-2">否</label>
				</div>
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
			<if condition="!empty($_GET['id'])">
				<input type="hidden" name="id" value="{$Think.get.id}">
			</if>
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>

<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").validate({
		rules:{
			navigation:{
				required:true,
				minlength:2,
				maxlength:16
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			$(form).ajaxSubmit({
				type:'post',
				url:'{:U("addNavigation")}',
				success:function (data){
					if(data.status == 1){
						layer.msg('成功',{icon:6,time:1000});
						setTimeout(function (){
							var index = parent.layer.getFrameIndex(window.name);
							parent.location.reload();
							parent.layer.close(index);
						},1000)
					}else {
						layer.msg('失败',{icon:5,time:1000});
					}
				}
			});
		}
	});
});
</script> 
</block>